<?php

    function linkMysql($host,$username,$password,$database){
        $link = new mysqli($hostm,$username,$password,$database);
        if($link->connect_error<>0){
            die('连接失败');
        }
        return $link;
    }
    $db = linkMysql('127.0.0.1','root','abcd1234','Bookstore');
    $res = $db->query('');
    var_dump($db);

?>